﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WeatherHistory.Data.Entities;

public class Region : EntityBase
{
    [Required]
    public long Id { get; set; }

    [Required]
    [Column(TypeName = "varchar(256)")]
    public string Name { get; set; }

    public long CreatedById { get; set; }
    public long? ParentRegionId { get; set; }

    public long? RegionTypeId { get; set; }

    [Required]
    [Column(TypeName = "numeric")]
    public double Latitude { get; set; }

    [Required]
    [Column(TypeName = "numeric")]
    public double Longitude { get; set; }

    public virtual Account UpdatedBy { get; set; }
    public virtual Region ParentRegion { get; set; }
    public virtual RegionType RegionType { get; set; }
    public virtual ICollection<Region> ChildRegions { get; set; }
    public virtual ICollection<Forecast> Forecasts { get; set; }
    public virtual ICollection<Weather> Weathers { get; set; }
    public virtual ICollection<WeatherRegionRelation> WeatherRegionRelations { get; set; }
}